package com.chigga.common.core.domain;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 分页结果对象
 * @param <T> 分页列表数据类型
 * @author DefChigga
 */
@Schema(description = "分页结果对象")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class PageResult<T> {
    /**
     * 分页列表
     */
    @Schema(description = "分页列表")
    private List<T> records;

    /**
     * 总条数
     */
    @Schema(description = "总条数")
    private Long total;

    /**
     * 每页条数
     */
    @Schema(description = "每页条数")
    private Long size;

    /**
     * 当前页码
     */
    @Schema(description = "当前页码")
    private Long current;

    /**
     * 总页数
     */
    @Schema(description = "总页数")
    private Long pages;
}
